<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .del{
      color: red;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <ul class="list">
    <li>香蕉 <span class="del">删除</span></li>
    <li>苹果 <span class="del">删除</span></li>
    <li>鸭梨 <span class="del">删除</span></li>
    <li>西瓜 <span class="del">删除</span></li>
    <li>葡萄 <span class="del">删除</span></li>
  </ul>
  <script>
    var aDel = document.querySelectorAll(".del");
    for(var i=0;i<aDel.length;i++){
      aDel[i].onclick = function(){
        var oParent = this.parentNode;
        oParent.parentNode.removeChild(oParent);
      }
    }
  </script>
</body>
</html>